#ifndef VECTORINTERFACE_H
#define VECTORINTERFACE_H

template <class T> class VectorInterface
{
private:
	unsigned int insertAt;
	unsigned int allocatedSize;
	T* items;
public:
	VectorInterface(void){
		insertAt = 0;
		allocatedSize = 20;
		items = new T[allocatedSize];
	}
	
	VectorInterface(unsigned int size) {
		insertAt = 0;
		allocatedSize = size;
		items = new T[allocatedSize];
	}

	unsigned int size() {
		return insertAt + 1;
	}

	bool add(T item) {
		if ( insertAt < allocatedSize) {
			items[insertAt] = item;
			insertAt++;
			return true;
		}
		return false;
	}

	T* get(unsigned int position) {
		if (position <= insertAt) {
			return (items + (position * sizeof(T)));
		} else {
			return NULL;
		}
	}

	virtual ~VectorInterface<T>(void) {
		delete[] items;
	}
};

class IntVector: public VectorInterface<int> {
public:
	IntVector(void): VectorInterface<int>(){}
	
	IntVector(unsigned int size): VectorInterface<int>(size) {}

	virtual ~IntVector(){}
};

#endif
